package com.example.demo.controller;


import com.example.demo.common.Result;
import com.example.demo.service.VideoHotReplyService;
import com.example.demo.utils.Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 第五小组
 * @since 2021-08-04
 */
@RestController
@RequestMapping("/bilibili")
public class VideoHotReplyController {

    @Autowired
    VideoHotReplyService videoHotReplyService;

    //根据bv号获得热评
    @GetMapping("/hotreply")
    public Result reply(@RequestParam("bv") String bv, HttpServletResponse response){
        Util.exec("\\脚本\\video_reply.py",bv);
        return Result.succ(videoHotReplyService.listMaps());
    }
}
